﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Styx;
using Styx.Helpers;
using Styx.Logic;
using Styx.WoWInternals;
using Styx.WoWInternals.WoWObjects;
using System.IO;

namespace SwInYUtility
{
    internal static class LootFilter
    {
        internal static string _FolderLocation = Logging.ApplicationPath + "\\Plugins\\SwInYUtility\\LootFilter";

        internal static void Initialize()
        {
            // Create Directory
            if (!Directory.Exists(_FolderLocation)) Directory.CreateDirectory(_FolderLocation);

            Log.Write(Log.eLogType.LootFilter, "Loaded!");
            Log.WriteDebug( Log.eLogType.LootFilter,"Enabled: {0}", Settings._Instance.RareKiller_Enabled);

            RemoveList.Initialize();
            KeepList.Initialize();

            // Lua Hooks
            Lua.Events.AttachEvent("LOOT_OPENED", LuaEvent);
            Lua.Events.AttachEvent("LOOT_CLOSED", LuaEvent);
            Lua.Events.AttachEvent("ITEM_LOCK_CHANGED", LuaEvent);
            Lua.Events.AttachEvent("MERCHANT_CLOSED", LuaEvent);
            Lua.Events.AttachEvent("MERCHANT_SHOW", LuaEvent);
        }

        internal static void Dispose()
        {
        }


        public static void LuaEvent(object sender, LuaEventArgs args)
        {
            if (!Settings._Instance.LootFilter_Enabled) return;

            Log.Write(Log.eLogType.LootFilter, "In Event");
        }

    }
}
